/***************************************************************************
*   Copyright (C) 2007 by crackedmind                                     *
*   digital.stream.of.mind@gmail.com                                      *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Library General Public License as       *
*   published by the Free Software Foundation; either version 2 of the    *
*   License, or (at your option) any later version.                       *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU Library General Public     *
*   License along with this program; if not, write to the                 *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/
#ifndef JAMFS_IFOLDER_HPP_INCLUDED
#define JAMFS_IFOLDER_HPP_INCLUDED

namespace jamfs
{
	class IFile
	{
    public:
		virtual ~IFile() {};
		virtual size_t read     ( uint8_t *buffer, size_t size, size_t count = 1 ) = 0;
		virtual size_t write    ( const uint8_t *buffer, size_t size, size_t count = 1 ) = 0;
		virtual size_t tell     () = 0;
	};

	class IFolder
	{
    public:
		virtual ~IFolder() {};
		virtual std::string	type () = 0;

		virtual IFile*  open	( const char *foldername, const char *filename, const char *mode ) = 0;
		virtual void    close	( IFile *file ) = 0;
		virtual bool    lookup  ( const char *foldername, const char *filename ) = 0;
	};
}

#endif // JAMFS_IFOLDER_HPP_INCLUDED
